const router = require('koa-router')()
const articleModel = require('../model/article')

router.get('/', async (ctx) =>{
    ctx.body = '文章列表'
    articleModel.find({},(err, docs) => {
        if(err) {
            console.log(err)
            return
        }
        console.log(docs)
    })
})

router.post('/add', async (ctx) =>{
    console.log(ctx.request.body)
    ctx.body = '文章增加数据'
})

router.get('/list', async (ctx) => {
    ctx.body = '文章列表'
})

module.exports = router.routes()
